﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SpaceInvaders_LeonardoCamelo
{
    public abstract class GameObject //Classe abstrata de objeto de jogo.
    {
        public Texture2D texture; //Textura do objeto.
        public Rectangle rectanglePicture; //Retângulo na tela in-game.

        //Metodo de desenho.
        public void Draw(SpriteBatch spriteBatch)
        {
            //Desenhamos o objeto.
            spriteBatch.Draw(this.texture, this.rectanglePicture, Color.White);
        }

        //Metodo que define os limites do objeto para colisão.
        public BoundingBox GetBounding()
        {
            return new BoundingBox(new Vector3(this.rectanglePicture.X,
                    this.rectanglePicture.Y, 0.0f),
                new Vector3(this.rectanglePicture.X + this.rectanglePicture.Width,
                    this.rectanglePicture.Y + this.rectanglePicture.Height, 0.0f));
        }
    }
}
